package com.qf.service.impl;

import com.qf.dao.SpeakerMapper;
import com.qf.dao.VideoMapper;
import com.qf.pojo.QueryVo;
import com.qf.pojo.Video;
import com.qf.pojo.VideoExample;
import com.qf.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 张鑫
 * @date 2020/10/19 21:05
 */
@Service
public class VideoServiceImpl implements VideoService {

    @Autowired
    private VideoMapper videoMapper;
    @Autowired
    private SpeakerMapper speakerMapper;


    @Override
    public List<Video> findAll(QueryVo queryVo) {
        return videoMapper.findAll(queryVo);
    }

    @Override
    public void addVideo(Video video) {
        videoMapper.insert(video);
    }

    @Override
    public Video findById(Integer id) {
        return videoMapper.selectByPrimaryKey(id);
    }

    @Override
    public Video findByVideoId(Integer videoId) {
        return videoMapper.findByVideoId(videoId);
    }

    @Override
    public void modifyVideo(Video video) {

        videoMapper.updateByPrimaryKeySelective(video);
    }

    @Override
    public void delVideo(Integer params) {
        videoMapper.deleteByPrimaryKey(params);
    }

    @Override
    public void update(Video video) {
        videoMapper.updateByPrimaryKeySelective(video);
    }
}
